package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.DeviceDataPageReqDto;
import com.zzyl.service.DeviceDataService;
import com.zzyl.vo.DeviceDataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description DeviceDataController
 * @Author shejunlian
 * @Date 2024-07-24
 */

@RestController
@RequestMapping("/device-data")
@Api(value = "管理端 - 设备数据相关接口")
public class DeviceDataController {

    @Autowired
    private DeviceDataService deviceDataService;


    /**
     * 设备数据分页查询请求模型
     * @param deviceDataPageReqDto
     * @return
     */
    @GetMapping("/get-page")
    @ApiOperation("分页查询请求模型监测数据")
    public ResponseResult<PageResponse<DeviceDataVo>> getDeviceDataPage(DeviceDataPageReqDto deviceDataPageReqDto) {
        PageResponse<DeviceDataVo> deviceDataVoPageResponse = deviceDataService.selectByPage(deviceDataPageReqDto);
        return ResponseResult.success(deviceDataVoPageResponse);

    }


}
